﻿using System.Collections.Generic;
using System.Linq;

namespace ReactiveGraph.Core
{
    public class NodePath
    {
        private IEnumerable<IReactiveNode> _steps;

        public IEnumerable<IReactiveNode> Steps
        {
            get { return _steps; }
        }

        public static NodePath WithNodes(params IReactiveNode[] nodes)
        {
            var stack = new List<IReactiveNode>(nodes);
            return new NodePath {_steps = stack};
        }


        public NodePath Concat(IReactiveNode node)
        {
            return WithNodes(new[] {node}.Concat(Steps).ToArray());
        }
    }
}